//
//  ZCXUserPetDetialTableViewCell.m
//  LoveOfPet
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "ZCXUserPetDetialTableViewCell.h"
#define HEIGHT  [[UIScreen mainScreen]bounds].size.height / 667
#define WIDTH   [[UIScreen mainScreen]bounds].size.width / 375
@interface ZCXUserPetDetialTableViewCell ()
@property (nonatomic, retain) UILabel *nameLabel;
@property (nonatomic, retain) UILabel *valueLabel;
@end

@implementation ZCXUserPetDetialTableViewCell
- (void)dealloc{
    [_valueLabel release];
    [_nameLabel release];
    [_name release];
    [_values release];
    [super dealloc];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.nameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_nameLabel];
        [_nameLabel release];
        
        self.valueLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_valueLabel];
        [_valueLabel release];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(10 * WIDTH, 5 * HEIGHT, 100 * WIDTH, 40 * HEIGHT);
    self.valueLabel.frame = CGRectMake(self.frame.size.width - 110 * WIDTH, 5 * HEIGHT, 100 * WIDTH, 40 * HEIGHT);
}
- (void)setName:(NSString *)name{
    if (_name != name) {
        [_name release];
        _name = [name copy];
    }
    self.nameLabel.text = name;
}
- (void)setValues:(NSString *)values{
    if (_values != values ) {
        [_values release];
        _values = [values copy];
    }
    self.valueLabel.textAlignment = NSTextAlignmentRight;
    if ([values isEqualToString:@"m"]) {
        self.valueLabel.text = @"男";
    }else if ([values isEqualToString:@"f"]){
        self.valueLabel.text = @"女";
    }else{
        self.valueLabel.text = [NSString stringWithFormat:@"%@", values];
    }
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
